package com.joysuch.wwyt.risk.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author ZhaoQiuWei
 * @Date 2021/11/22 15:09
 */
public enum ControlRiskLevelType {
    //无效
    INVALID(0, "无效"),

    EFFICIENT(1, "有效");


    private Integer value;

    private String desc;

    ControlRiskLevelType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<Integer, ControlRiskLevelType> lookup = new HashMap<>();

    static {
        for (ControlRiskLevelType e : EnumSet.allOf(ControlRiskLevelType.class)) {
            lookup.put(e.value, e);
        }
    }

    public static ControlRiskLevelType find(Integer value) {
        return lookup.get(value);
    }
}
